yjx.config(['$httpProvider', '$stateProvider', '$urlRouterProvider', '$locationProvider',
    function ($httpProvider, $stateProvider, $urlRouterProvider, $locationProvider) {
        //$httpProvider.interceptors.push('PageInterceptor');
        // $locationProvider.html5Mode(true);
        //定义默认路由
        $urlRouterProvider.when("", "/");
        //$urlRouterProvider.when("#", "");
        //$urlRouterProvider.otherwise("/index");
        //.state('[一级路由.二级路由...]'), { url:'[链接]', templateUrl:'[引入页面]'}
        //满屏模块
        $stateProvider.state('yjx', {
            //abstract: true,
            url: "/yjx",
            templateUrl: "components/fullscreen/fullscreen.html"
        }).state('yjx.loading', {
            url: "/loading",
            views: {
                "fullscreen@yjx": {templateUrl: "components/fullscreen/loading/loading.html"}
            },
        });
        $stateProvider.state('index', {
            url: "/",
            //templateUrl: "components/user/login/login.html",
            templateUrl: "components/home/index.html",
            controller: "WxController",
        });

        //$stateProvider.state('index', {
        //    url: "/",
        //    //templateUrl: "components/user/login/login.html",
        //    templateUrl: "components/home/index.html",
        //    controller: "WxController",
        //});
        //$stateProvider.state('home', {
        //    url: "/home",
        //    templateUrl: "components/home/index.html",
        //    //controller: "WxController",
        //});

        //    $stateProvider.state('index',{
        //    url:'/index',
        //    templateUrl:'components/home/index.html',
        //    controller: "WxController",
        //})
        /*banner详情*/
        $stateProvider.state('bannerDetail',{
            url:'/bannerDetail?:id:forwardId:pendingEventId',
            templateUrl:'components/home/banner/bannerIntro.html',
            params:{id:null,forwardId:null,pendingEventId:null},
        })
        /*我本月佣金*/
        $stateProvider.state('myBrokerage',{
            url:'/myBrokerage',
            templateUrl:'components/home/brokerage/myBrokerage.html'
        })
        /*我未来可获得佣金*/
        $stateProvider.state('unBrokerage',{
            url:'/unBrokerage',
            templateUrl:'components/home/brokerage/unBrokerage.html'
        })
        /*编辑个人信息*/
        $stateProvider.state('profile',{
            url:'/profile',
            templateUrl:'components/user/profile/profile.html'
        })
        /*我的订单列表*/
        $stateProvider.state('orderList',{
            url:'/orderList',
            templateUrl:'components/order/orderList.html'
        })
        /*下订单*/
        $stateProvider.state('order',{
            url:'/order?:id:forwardId:forwardName:pendingEventId:clientId:type',
            templateUrl:'components/order/orderPay/order.html',
            params:({id:null,forwardId:null,forwardName:null,pendingEventId:null,clientId:null,type:null})
        })
        /*客户列表*/
        $stateProvider.state('clientList',{
            url:'/clientList',
            templateUrl:'components/client/clientList.html'
        }).state('clientList.info',{
                url:'/info?:userId',
                templateUrl:'components/client/clientInfo/clientInfo.html',
                params:{userId:null}
            })
        ///*编辑客户*/
        //$stateProvider.state('clientInfo',{
        //    url:'/clientInfo',
        //    templateUrl:'components/client/clientInfo/clientInfo.html',
        //    params:{userId:null}
        //})
        /*客户关系树*/
        $stateProvider.state('cRelationship',{
            url:'/cRelationship?:customerId:customerName',
            templateUrl:'components/client/clientRelationships/cRelationship.html',
            params:{customerId:null,customerName:null}
        }).state('cRelationship.edit',{
                url:'/edit',
                templateUrl:'components/client/editRelation/editRelation.html',
                //params:{customerId:null,customerName:null}
            }
        )
        ///*编辑客户关系*/
        //$stateProvider.state('editRelation',{
        //    url:'/editRelation?:customerId:customerName',
        //    templateUrl:'components/client/editRelation/editRelation.html',
        //    params:{customerId:null,customerName:null}
        //})
        /*产品搜索结果*/
        $stateProvider.state('productList',{
            url:'/productList?:keyword:tagId',
            templateUrl:'components/product/result/productList.html',
            params: {keyword:null,tagId:null},
        })
        /*产品详情*/
        $stateProvider.state('productDetail',{
            url:'/productDetail?:id:forwardId:pendingEventId:pdfUrl',
            templateUrl:'components/product/productDetail/productDetail.html',
            params:{id:null,forwardId:null,pendingEventId:null,pdfUrl:null},
        }).state('productDetail.orderClient',{
            url:'/orderClient?:id:type',
            templateUrl:'components/product/productDetail/orderClient.html',
            params:{id:null,type:null}
        })
        /*预约列表*/
        $stateProvider.state('reservationList',{
            url:'/reservationList',
            templateUrl:'components/reservation/reservationList.html',
            params:{id:null,activityId:null},
        })
        /*我的团队*/
        $stateProvider.state('team',{
            url:'/team',
            templateUrl:'components/user/team/team.html'
        })
        /*待办事项*/
        $stateProvider.state('todo',{
            url:'/todo',
            templateUrl:'components/user/todo/todo.html'
        })
        /*我要提现*/
        $stateProvider.state('withdraw',{
            url:'/withdraw',
            templateUrl:'components/user/withdraw/withdraw.html'
        })
        /*机构详情*/
        $stateProvider.state('orgIntro',{
            url:'/orgIntro',
            templateUrl:'components/home/organization/orgIntro.html',
            params:{id:null}
        })
        /*课程详情*/
        $stateProvider.state('courseIntro',{
            url:'/courseIntro?id',
            templateUrl:'components/home/recCourse/courseIntro.html',
            params:{id:null}
        })
        /*获得支持详情*/
        $stateProvider.state('surDetail',{
            url:'/surDetail?:id:forwardId:pendingEventId',
            templateUrl:'components/support/detail/supoortDetail.html',
            params:{id:null,forwardId:null,pendingEventId:null},
        })
        /*与客户聊天界面*/
        $stateProvider.state('chat',{
            url:'/chat',
            templateUrl:'components/IM/chat.html',
        })
        /*消息列表*/
        $stateProvider.state('message',{
            url:'/message',
            templateUrl:'components/user/message/message.html',
        })
        /*关于我们*/
        $stateProvider.state('about',{
            url:'/about',
            templateUrl:'components/about/about.html',
        })



        $stateProvider.state('details', {
            url: '/details',
            templateUrl: 'components/test/details.html',
            reloadOnSearch: false
        });
        $stateProvider.state('testdetail3', {
            url: '/testdetail3',
            views: {
                'vWindow': {templateUrl: "components/common/layout/appDetail.html"},//新窗口路由
                'detailBody@testdetail3': {templateUrl: 'components/test/detail3.html',}//模板内容会被安插在父路由testdetail3模板中视图名为detailBody下 新窗口内容detailBody：uiview名称；
            }
        });
        $stateProvider.state('pay', {
            url: '/pay',
            templateUrl: "components/pay/payform.html",//新窗口路由
        });



        //$stateProvider.state('testscroll', {
        //    url: "/testscroll",
        //    templateUrl: "components/home/testScroll.html",
        //});
        //$stateProvider.state('login',{
        //    url:'/bind',
        //    templateUrl:"components/user/login/login.html",
        //})


        $stateProvider.state('notFound', {
            url: '/notFound',
            templateUrl: "404.html",
        })


        $stateProvider.state('qvod', {
            url: '/qvod',
            templateUrl: "components/test/testQvod.html",
            controller: 'wxpayController',
        })

        //去#号 首页需加<base href="/">
        //手机端不需要避免引起刷新找不到页面(bug未知) $locationProvider.html5Mode(true);
    }]);
